<!--  -->
<template>
    <div class="boufei">
        <div class="boufeidy">
            <a-form :model="form" :style="{ width: '400px' }" @submit="handleSubmit" >
                <div :style="{ height: '20px' }"></div>
                <a-form-item field="recordCode" label="记录单号:" label-col-flex="80px">
                    <a-input v-model="form.recordCode" :style="{ width: '250px' }" disabled/>
                </a-form-item>
                <div :style="{ height: '20px' }"></div>
                <a-form-item field="printTime" label="打印日期:" label-col-flex="80px">
                    <a-input v-model="form.printTime" :style="{ width: '250px' }" disabled/>
                </a-form-item>
                <div :style="{ height: '20px' }"></div>
                <!-- <a-form-item field="modelName" label="打印模板:">
                        <a-select popup-container="html"  @click="dyMbArray" @change="dyMbChanges" placeholder="请选择打印模板" allow-clear
                            :style="{ width: '250px' }" allow-search v-model="form.modelName">
                            <a-option v-for="item in idDataArray">{{ item.modelName }}</a-option>
                        </a-select>
                    </a-form-item> -->
                <a-form-item field="machineCode" label="机台号:" label-col-flex="80px">
                    <a-select popup-container="html"  class="bacClass" v-if="(form.printNum == 0)" @click="dyJthq" @change="jitaihaiId"
                              placeholder="" allow-clear :style="{ width: '250px' }" allow-search
                              v-model="form.machineCode">
                        <a-option v-for="item in jtArray">{{ item.machineCode }}</a-option>
                    </a-select>
                    <a-select popup-container="html"  class="bacClass" v-else disabled @click="dyJthq" @change="jitaihaiId" placeholder=""
                              allow-clear :style="{ width: '250px' }" allow-search v-model="form.machineCode">
                        <a-option v-for="item in jtArray">{{ item.machineCode }}</a-option>
                    </a-select>
                </a-form-item>
                <div :style="{ height: '20px' }"></div>
                <a-form-item field="startHorseNo" label="开始匹号:" label-col-flex="80px">
                    <a-input-number class="bacClass" v-if="(form.printNum == 0)" @change="changeStart"
                                    v-model="form.startHorseNo" placeholder="" :style="{ width: '250px' }"/>
                    <a-input-number class="bacClass" v-else v-model="form.startHorseNo" disabled
                                    :style="{ width: '250px' }"/>
                </a-form-item>
                <div :style="{ height: '20px' }"></div>
                <a-form-item field="printNum" label="打印数量:" label-col-flex="80px">
                    <a-input-number class="bacClass" v-if="(form.printNum == 0)" @change="asdasd"
                                    v-model="form.printNum"
                                    :style="{ width: '250px' }"/>
                    <a-input-number class="bacClass" v-else v-model="form.printNum" disabled
                                    :style="{ width: '250px' }"/>
                </a-form-item>
                <div :style="{ height: '20px' }"></div>
                <!-- <a-form-item field="isRead">
                        <a-checkbox v-model="form.isRead">
                            是否布打
                        </a-checkbox>
                    </a-form-item> -->
                <a-form-item>
                    <a-space>
                        <a-button @click="qxdy">取消</a-button>
                        <!-- <a-button html-type="submit" type="outline">确认</a-button> -->
                        <a-button html-type="submit" type="primary" @click="print">打印</a-button>
                    </a-space>
                </a-form-item>
            </a-form>
        </div>
        <div class="boufei1" ref="boufei1" id="dayingbufei">
            <div class="bfList" v-for="(item, index) in (form.printNum == 0 ? 1 : form.printNum)" ref="bfLists">
                <div ref="wrappers">
                    <p></p>
                    <!-- <img src='@/assets/R-C.jpg' /> -->
                </div>
                <img id="qrcode" v-show="isEerweimas.length != 0" :src="isEerweimas[index]"/>
                <img id="qrcode2" v-show="isEerweimas2.length != 0" :src="isEerweimas2[index]"/>
                <!-- <div style="page-break-after:always; height:0px; width:0px;"></div> -->
            </div>
        </div>
    </div>
    <!-- <div v-for="item in textID" id="qrcode"  ref="qrcodesVues"> -->
    <!-- <QrcodeVue v-for="item in textID" id="qrcode" ref="qrcodesVues"
                :value="JSON.stringify({ clothfiyCode: item.clothfiyCode, planOrderCode: item.planOrderCode, houseNo: item.houseNo, clothCode: item.clothCode })">
                </QrcodeVue> -->
    <!-- </div> -->
    <!-- <Barcode id="qrcodes" v-for="item in textID" :value="item.barCode"></Barcode> -->
    <!-- <img :id="'qrcode'+index" ref="imgCodes" v-for="(item,index) in isEerweimas" :src="item"/> -->
</template>

<script lang='ts' setup>

    import {reactive, toRefs, ref, onMounted, nextTick} from 'vue'
    import emitter from '@/hooks/useEventBus'
    import {post} from '@/api/http'
    import {Message, Modal} from '@arco-design/web-vue'
    import printJS from 'print-js'
    import QrcodeVue from 'qrcode.vue'
    import pinia from '@/store/pinia'
    // @ts-nocheck
    // import { getLodop } from "@/utils/LodopFuncs.js"
    import html2canvas from 'html2canvas'
    import {log} from 'console'


    const changeStart = (val: any) => {
        if (form.machineCode == '') {
            Message.error('请先选择机台')
            form.startHorseNo = 0
            return
        }
        let startHorseNos = document.getElementById('startHorseNo')
        if (startHorseNos) {
            startHorseNos.innerHTML = val
        }
    }

    let boufei1 = ref()
    const imgCodes = ref()
    const print = () => {
        let pihao: any = document.querySelectorAll('#pihao')
        isAaaryDatas.value.forEach((items: any, index: any) => {
            for (let item in chuncuObj) {
                if (item == 'horseNo') {
                    items[item] = pihao[index].innerHTML
                } else {
                    items[item] = chuncuObj[item]
                }
            }
        })
        Modal.confirm({
            title: '系统提示',
            content: '点击确认不可撤销',
            onOk: async () => {
                const res: any = await post(
                    {
                        url: 'planSingle/clothfiy/getMachineGreyCode',
                        data: {
                            machineCode: form.machineCode
                        }
                    }
                )
                if (res.code == 200) {
                    // let jibuhaos: any = document.querySelectorAll('#jibuhaos')
                    // let pihao: any = document.querySelectorAll('#pihao')
                    // let nubers = form.startHorseNo
                    // let nujibuhao: any = res.data.machineGreyCode
                    // for (let i = 0; i < form.printNum; i++) {
                    //     pihao[i].innerHTML = nubers++
                    //     jibuhaos[i].innerHTML = nujibuhao++
                    //     isAaaryDatas.value.push(
                    //         {
                    //             horseNo: pihao[i].innerHTML,
                    //             clothfiyCode: textID.value[i].clothfiyCode,
                    //             machineCode: jibuhaos[i].innerHTML
                    //         }
                    //     )
                    // }
                    post({
                        url: 'planSingle/clothfiy/add',
                        data: isAaaryDatas.value
                    }).then((res: any) => {
                        if (res.code == 200) {
                            Message.success('数据添加成功')
                            printJS({
                                printable: 'dayingbufei',
                                type: 'html',
                                font_size: "",
                                targetStyles: ['*'],
                            })
                            // printPdf()
                            // let dataList: any;
                            // bfLists.value.forEach((o:any)=>{
                            //     html2canvas(o).then(canvas => {
                            //     dataList = canvas.toDataURL('image/png')
                            // }).finally(()=>{
                            //     console.log(dataList)
                            // })
                            // })
                            // html2canvas(bfLists.value[0]).then(canvas => {
                            //     var printwindow:any = window.open( "data:application/pdf;base64, " + canvas.toDataURL('image/png') );
                            //       printwindow.print();
                            //     // dataList = canvas.toDataURL('image/png')
                            //     // console.log(dataList)
                            //     // printPdf(dataList)
                            // })

                            // let newPage:any = window.open()
                            // const wpt:any = document.getElementById("dayingbufei")
                            // const newContent = wpt.innerHTML
                            // newPage.document.body.innerHTML = newContent
                            // newPage.document.getElementsByTagName("body")[0].style.zoom = 0.86
                            // newPage.print()
                            emitter.emit('qxs')
                            form.recordCode = ''
                            form.printTime = ''
                            form.modelName = ''
                            form.machineCode = ''
                            form.startHorseNo = 0
                            form.printNum = 0
                            wrappers.value[0].innerHTML = "<p></p>"
                            visible1s.showAdd = false
                            isAaaryDatas.value = []
                            textID.value = []
                            isEerweimas.value = []
                            isEerweimas2.value = []
                        } else {
                            Message.error(res.message)
                        }
                    })
                }
            }
        })
    }

    // const printPdf = (strBASE64Code:any) => {
    //     // let LODOP = getLodop();
    //     // LODOP.SET_LICENSES("", "152A06E8F6CBD6AC1F213ABFCB0D8604", "C94CEE276DB2187AE6B65D56B3FC2848", "");

    //     // LODOP.PRINT_INIT("拼版标识卡");
    //     // LODOP.SET_PRINT_STYLE("FontSize", 16);
    //     // LODOP.SET_PRINT_STYLE("Bold", 1);

    //     // LODOP.SET_PRINT_PAGESIZE(2, "56", "210mm", 'A4') // 纸张方向大小
    //     // LODOP.SET_PREVIEW_WINDOW(0, 0, 0, 800, 800, '') // 演示设置各种样式的打印预览窗口：


    //     // LODOP.ADD_PRINT_HTM(30, 10, 2000, 2900, document.getElementById('dayingbufei').innerHTML); // print为要打印的html ID名称：
    //     // LODOP.ADD_PRINT_SETUP_BKIMG(strBASE64Code);

    //     // LODOP.SET_PRINT_STYLEA(0,"QRCodeVersion",14);
    //     // LODOP.SET_PRINT_STYLEA(0, "QRCodeErrorLevel", "M");
    //     // LODOP.ADD_PRINT_BARCODE(52, 668, '27mm', '27mm', "QRCode", '123456');
    //     // LODOP.PRINT()    //直接打印
    //     // LODOP.PRINT_DESIGN() // 设计模式
    //     // LODOP.PREVIEW() // 打印预览
    //        let LODOP=getLodop();
    //         LODOP.PRINT_INIT("");//初始化
    //         LODOP.ADD_PRINT_SHAPE(4,-1,0,216,343,0,1,"#fff");
    //         LODOP.ADD_PRINT_IMAGE(strBASE64Code);
    //         LODOP.PRINT_DESIGN();

    // }

    const chuncuObj: any = reactive({})
    const jitaihaiId = async (val: any) => {
        let planOrderCode = document.getElementById('planOrderCode')
        let customOrderNo = document.getElementById('customOrderNo')
        let customName = document.getElementById('customName')
        let pieceWeight = document.getElementById('pieceWeight')
        let pieceNum = document.getElementById('pieceNum')
        let weaveCode = document.getElementById('weaveCode')
        let greyCode = document.getElementById('greyCode')
        let greyName = document.getElementById('greyName')
        let greyBatchNo = document.getElementById('greyBatchNo')
        let yarnCount = document.getElementById('yarnCount')
        let yarnBatch = document.getElementById('yarnBatch')
        let brandName = document.getElementById('brandName')
        let customProductName = document.getElementById('customProductName')
        let customNameRaw = document.getElementById('customNameRaw')
        let drawnNeedleState = document.getElementById('drawnNeedleState')
        let workDrum = document.getElementById('workDrum')
        let typeDate = document.getElementById('typeDate')
        let width = document.getElementById('width')
        let weight = document.getElementById('weight')
        let colorName = document.getElementById('colorName')
        let machineCode = document.getElementById('machineCode')
        let storey = document.getElementById('storey')
        let outSouringCompany = document.getElementById('outSouringCompany')
        let verifyClothCompany = document.getElementById('verifyClothCompany')
        let orderDepartment = document.getElementById('orderDepartment')
        let rubberTube = document.getElementById('rubberTube')
        let startHorseNo = document.getElementById('startHorseNo')
        let auditDate = document.getElementById('auditDate')
        let recordCode = document.getElementById('recordCode')
        let endHorseNo = document.getElementById('endHorseNo')
        let auditPerson = document.getElementById('auditPerson')
        let pihao = document.getElementById('pihao')
        let jibuhaos = document.getElementById('jibuhaos')
        const sres: any = await post({
            url: 'planSingle/clothfiy/getMachineGreyCode',
            data: {
                machineCode: val
            }
        })
        if (sres.code == 200) {
            form.jibuhao = sres.data.machineGreyCode
            if (jibuhaos) {
                jibuhaos.innerHTML = sres.data.machineGreyCode
                // chuncuObj.machineGreyCode = sres.machineGreyCode
            }
        }
        const res = await post({
            url: 'planSingle/clothfiy/getClothfiy',
            data: [
                {
                    planOrderCode: jhDanhao,
                    machineCode: val
                }
            ]
        })

        if (res.code == 200) {
            form.startHorseNo = res.data[0].horseNo
            for (let item in res.data[0]) {
                chuncuObj[item] = res.data[0][item]
                delete chuncuObj['id']
            }

            if (planOrderCode) {
                planOrderCode.innerHTML = res.data[0].planOrderCode
                chuncuObj.planOrderCode = res.data[0].planOrderCode
            }
            if (customOrderNo) {
                customOrderNo.innerHTML = res.data[0].customOrderNo
                chuncuObj.customOrderNo = res.data[0].customOrderNo
            }
            if (customName) {
                customName.innerHTML = res.data[0].customName
                chuncuObj.customName = res.data[0].customName
            }
            if (pieceWeight) {
                pieceWeight.innerHTML = res.data[0].pieceWeight
                chuncuObj.pieceWeight = res.data[0].pieceWeight
            }
            if (pieceNum) {
                pieceNum.innerHTML = res.data[0].pieceNum
                chuncuObj.pieceNum = res.data[0].pieceNum
            }
            if (weaveCode) {
                weaveCode.innerHTML = res.data[0].weaveCode
                chuncuObj.weaveCode = res.data[0].weaveCode
            }
            if (greyCode) {
                greyCode.innerHTML = res.data[0].greyCode
                chuncuObj.greyCode = res.data[0].greyCode
            }
            if (greyName) {
                greyName.innerHTML = res.data[0].greyName
                chuncuObj.greyName = res.data[0].greyName
            }
            if (greyBatchNo) {
                greyBatchNo.innerHTML = res.data[0].greyBatchNo
                chuncuObj.greyBatchNo = res.data[0].greyBatchNo
            }
            if (yarnCount) {
                yarnCount.innerHTML = res.data[0].yarnCount
                chuncuObj.yarnCount = res.data[0].yarnCount
            }
            if (yarnBatch) {
                yarnBatch.innerHTML = ''
                res.data[0].yarnList.forEach((e: any) => {
                    let div = document.createElement('div')
                    div.innerHTML = e.yarnCard
                    yarnBatch?.appendChild(div)
                })
                // yarnBatch.innerHTML = res.data[0].yarnBatch
                chuncuObj.yarnList = res.data[0].yarnList
            }
            if (brandName) {
                brandName.innerHTML = ''
                res.data[0].yarnList.forEach((e: any) => {
                    let div = document.createElement('div')
                    div.innerHTML = e.batch
                    brandName?.appendChild(div)
                })
                chuncuObj.yarnList = res.data[0].yarnList
            }
            if (customProductName) {
                customProductName.innerHTML = res.data[0].customProductName
                chuncuObj.customProductName = res.data[0].customProductName
            }
            if (customNameRaw) {
                customNameRaw.innerHTML = res.data[0].customNameRaw
                chuncuObj.customNameRaw = res.data[0].customNameRaw
            }
            if (drawnNeedleState) {
                drawnNeedleState.innerHTML = res.data[0].drawnNeedleState == 0 ? '圆筒' : '抽针'
                chuncuObj.drawnNeedleState = res.data[0].drawnNeedleState
            }
            if (workDrum) {
                workDrum.innerHTML = res.data[0].workDrum
                chuncuObj.workDrum = res.data[0].workDrum
            }
            if (typeDate) {
                typeDate.innerHTML = res.data[0].typeDate
                chuncuObj.typeDate = res.data[0].typeDate
            }
            if (width) {
                width.innerHTML = res.data[0].width
                chuncuObj.width = res.data[0].width
            }
            if (weight) {
                weight.innerHTML = res.data[0].weight
                chuncuObj.weight = res.data[0].weight
            }
            if (colorName) {
                colorName.innerHTML = res.data[0].colorName
                chuncuObj.colorName = res.data[0].colorName
            }
            if (machineCode) {
                machineCode.innerHTML = res.data[0].machineCode
                chuncuObj.machineCode = res.data[0].machineCode
            }
            if (storey) {
                storey.innerHTML = res.data[0].storey
                chuncuObj.storey = res.data[0].storey
            }
            if (outSouringCompany) {
                outSouringCompany.innerHTML = res.data[0].outSouringCompany
                chuncuObj.outSouringCompany = res.data[0].outSouringCompany
            }
            if (verifyClothCompany) {
                verifyClothCompany.innerHTML = res.data[0].verifyClothCompany
                chuncuObj.verifyClothCompany = res.data[0].verifyClothCompany
            }
            if (orderDepartment) {
                orderDepartment.innerHTML = res.data[0].orderDepartment
                chuncuObj.orderDepartment = res.data[0].orderDepartment
            }
            if (rubberTube) {
                rubberTube.innerHTML = res.data[0].rubberTube
                chuncuObj.rubberTube = res.data[0].rubberTube
            }
            if (startHorseNo) {
                startHorseNo.innerHTML = res.data[0].startHorseNo
                chuncuObj.startHorseNo = res.data[0].startHorseNo
            }
            if (auditDate) {
                auditDate.innerHTML = res.data[0].auditDate
                chuncuObj.auditDate = res.data[0].auditDate
            }
            if (recordCode) {
                recordCode.innerHTML = res.data[0].recordCode
                chuncuObj.recordCode = res.data[0].recordCode
            }
            if (endHorseNo) {
                endHorseNo.innerHTML = res.data[0].endHorseNo
                chuncuObj.endHorseNo = res.data[0].endHorseNo
            }
            if (auditPerson) {
                auditPerson.innerHTML = res.data[0].auditPerson
                chuncuObj.auditPerson = res.data[0].auditPerson
            }

            if (pihao) {
                pihao.innerHTML = form.startHorseNo + ''
            }

        }
    }

    let textID = ref<any[]>([])
    let wrappers = ref()
    let isAaaryDatas = ref<any[]>([])
    const isEerweimas: any = ref([])
    const isEerweimas2: any = ref([])
    const qrcodesVues = ref()
    const asdasd = async (val: any) => {
        if (form.machineCode == '') {
            Message.error('请先选择机台')
            form.printNum = 0
            return
        }
        let endHorseNo = document.getElementById('endHorseNo')
        if (endHorseNo) {
            endHorseNo.innerHTML = form.startHorseNo + val
            chuncuObj.endHorseNo = form.startHorseNo + val
        }
        form.endHorseNo = form.startHorseNo + val
        console.log(form)
        setTimeout(() => {
            bfLists.value.forEach((item: any) => {
                if (isMb[0].width != '') {
                    item.style.width = Number(isMb[0].width) / 2.45 * js_getDPI()[0] + 'px'
                } else {
                    item.style.width = '364px'
                }
                if (isMb[0].height != '') {
                    item.style.height = Number(isMb[0].height) / 2.45 * js_getDPI()[0] + 'px'
                } else {
                    item.style.height = '792px'
                }
            })
            for (let i = 0; i < wrappers.value.length; i++) {
                if (i == 0) {
                    continue
                } else {
                    wrappers.value[i].innerHTML = wrappers.value[0].innerHTML
                }
            }
        }, 1)
        // setTimeout(()=>{
        //     for(let i = 0;i<val;i++){
        //         wrappers.value[i].appendChild(document.querySelectorAll('#qrcode')[i])
        //     }
        // },300)
        const resz = await post({
            url: 'planSingle/clothfiy/getQRAndBarCode',
            data: {
                planOrderCode: jhDanhao,
                machineCode: form.machineCode,
                startHorseNo: form.startHorseNo,
                printNum: val
            }
        })
        if (resz.code == 200) {
            post({
                url: 'planSingle/clothfiy/getQRPNG',
                data: {
                    "houseNo": form.startHorseNo,
                    "clothCode": form.jibuhao,
                    "num": val,
                    "planOrderCode": jhDanhao,
                    "greyCode": pibuCode,
                    "machineCode": form.machineCode
                }
            }).then((res: any) => {
                if (res.code == 200) {
                    res.data.QR.forEach((resss: any) => {
                        isEerweimas.value.push("data:image/png;base64," + resss)
                    })
                    res.data.Bar.forEach((ress: any) => {
                        isEerweimas2.value.push("data:image/png;base64," + ress)
                    })
                }
            })
            textID.value = resz.data
            //jhDanhao
            textID.value.forEach((o: any) => {
                o['planOrderCode'] = jhDanhao
                o['greyCode'] = pibuCode

            })
            setTimeout(() => {
                for (let i = 0; i < wrappers.value.length; i++) {
                    // wrappers.value[i].removeAttribute('id')
                    // const target: any = document.querySelectorAll('#qrcode')[i]
                    // const targets: any = document.querySelectorAll('#qrcodes')[i]
                    // const IdName= document.querySelectorAll('#IdName')[i] // 获取需要追加Dom元素的Id
                    // const target2 = qrcodesVues.value[i].cloneNode(true)
                    // const target2 = target.cloneNode(true)
                    // const targets2 = targets.cloneNode(true)
                    // console.log(qrcodesVues.value[i])
                    // wrappers.value[i].appendChild(target)
                    // wrappers.value[i].appendChild(targets)
                }
                let pihao: any = document.querySelectorAll('#pihao')
                let jibuhaos: any = document.querySelectorAll('#jibuhaos')
                let nubers = form.startHorseNo
                let nujibuhao: any = form.jibuhao
                for (let i = 0; i < val; i++) {
                    pihao[i].innerHTML = nubers++
                    jibuhaos[i].innerHTML = nujibuhao++
                    isAaaryDatas.value.push(
                        {
                            horseNo: pihao[i].innerHTML,
                            clothfiyCode: textID.value[i].clothfiyCode,
                            machineGreyCode: jibuhaos[i].innerHTML
                        }
                    )
                    textID.value[i]['houseNo'] = pihao[i].innerHTML
                    textID.value[i]['clothCode'] = jibuhaos[i].innerHTML
                }
                console.log(textID.value)
            }, 2)
        }
    }
    emitter.on('hqzdy', (res: any) => {
        isMb = [res]
        form.recordCode = res.recordCode
        form.printTime = res.printTime
        widths.value = Number(res.width) / 2.45 * js_getDPI()[0] + 'px'
        heights.value = Number(res.height) / 2.45 * js_getDPI()[0] + 'px'
        // wrappers.value.innerHTML = isMb[0].modelDetail
        bfLists.value.forEach((item: any) => {
            if (res.width != '') {
                item.style.width = Number(res.width) / 2.45 * js_getDPI()[0] + 'px'
            } else {
                item.style.width = '364px'
            }
            if (res.height != '') {
                item.style.height = Number(res.height) / 2.45 * js_getDPI()[0] + 'px'
            } else {
                item.style.height = '792px'
            }
        })
        wrappers.value.forEach((item: any) => {
            // item.appendChild(parseDom(isMb[0].modelDetail))
            item.innerHTML = res.detail

        })

    })
    let jhDanhao = ''
    let pibuCode = ''
    emitter.on('hqJhd', (res: any) => {
        pibuCode = res[0].greyCode
        jhDanhao = res[0].planOrderCode
    })
    let jtArray: any = ref([])
    const dyJthq = async () => {
        const res: any = await post({
            url: 'planSingle/clothfiy/getMachineCodeList',
            data: {
                "planOrderCode": jhDanhao
            }
        })
        if (res.code == 200) {
            jtArray.value = res.data
        }
    }
    // let idDataArray: any = ref([])

    // const dyMbArray = async () => {
    //     const res = await post({
    //         url: 'planSingle/clothfiyprintmodel/getClothFiyPrintModel',
    //         data: {
    //             modelName: ''
    //         }
    //     })
    //     if (res.code == 200) {
    //         idDataArray.value = res.data
    //     }
    // }

    let isMb: any;
    let bfLists = ref()
    let widths = ref()
    let heights = ref()
    // const dyMbChanges = (val: any) => {
    //     if (val != '') {
    //         isMb = idDataArray.value.filter((res: any) => {
    //             return val == res.modelName
    //         })
    //         widths.value = isMb[0].width * 25 + 'px'
    //         heights.value = isMb[0].height * 25 + 'px'
    //         // wrappers.value.innerHTML = isMb[0].modelDetail
    //         bfLists.value.forEach((item: any) => {
    //             if (isMb[0].width != '') {
    //                 item.style.width = isMb[0].width * 25 + 'px'
    //             } else {
    //                 item.style.width = '364px'
    //             }
    //             if (isMb[0].height != '') {
    //                 item.style.height = isMb[0].height * 25 + 'px'
    //             } else {
    //                 item.style.height = '792px'
    //             }
    //         })
    //         wrappers.value.forEach((item: any) => {
    //             // item.appendChild(parseDom(isMb[0].modelDetail))
    //             item.innerHTML = isMb[0].modelDetail
    //         })
    //     } else {
    //         // wrappers.value.innerHTML ="<div data-v-974fcf04=\"\"></div><img src=\"/src/assets/R-C.jpg\" data-v-974fcf04=\"\">"
    //         wrappers.value.forEach((item: any) => {
    //             item.innerHTML = "<p data-v-974fcf04=\"\"></p><img src=\"/src/assets/R-C.jpg\" data-v-974fcf04=\"\">"
    //         })
    //     }
    // }

    function parseDom(arg: any) {
        var objE = document.createElement("div");
        objE.innerHTML = arg;
        return objE.childNodes;
    }

    const props = defineProps({
        visible1: Object
    });

    const visible1s: any = props.visible1
    const form = reactive({
        recordCode: '',
        printTime: '',
        isRead: false,
        modelName: '',
        machineCode: '',
        jibuhao: 0,
        startHorseNo: 0,
        endHorseNo: 0,
        printNum: 0
    })


    const handleSubmit = (data: any) => {
        console.log(data.values)
    }
    const qxdy = () => {
        bfLists.value.forEach((res: any) => {
            res.style.width = '364px'
            res.style.height = '792px'
        })
        emitter.emit('qxs')
        form.recordCode = ''
        form.printTime = ''
        form.modelName = ''
        form.machineCode = ''
        form.startHorseNo = 0
        form.printNum = 0
        wrappers.value[0].innerHTML = "<p></p>"
        visible1s.showAdd = false
        isAaaryDatas.value = []
        visible1s.showAdd = false
        textID.value = []
        isEerweimas.value = []
        isEerweimas2.value = []
    }

    function js_getDPI() {
        var arrDPI = new Array();
        if (window.screen?.deviceXDPI != undefined) {
            arrDPI[0] = window.screen?.deviceXDPI;
            arrDPI[1] = window.screen?.deviceYDPI;
        } else {
            var tmpNode: any = document.createElement("DIV");
            tmpNode.style.cssText = "width:1in;height:1in;position:absolute;left:0px;top:0px;z-index:99;visibility:hidden";
            document.body.appendChild(tmpNode);
            arrDPI[0] = parseInt(tmpNode.offsetWidth);
            arrDPI[1] = parseInt(tmpNode.offsetHeight);
            tmpNode.parentNode.removeChild(tmpNode);
        }
        return arrDPI;
    }
</script>
<style lang='less'>
    @import '@/styles/boufeiList.less';

    #boufeis {
        display: flex;
    }

    .boufeidy {
        width: 35%;
        height: 100%;
        position: relative;
        right: 300px;
        float: right;
        text-align: right;

        form {
            position: absolute !important;
            right: 10px !important;
        }
    }

    // #isImgs{
    //     width: 60px;
    //     height: 60px;
    // }
</style>